package com.piccolo.wrapper.client.component;

import com.piccolo.wrapper.client.component.Overlay.PActivitySchedulerOverlay;

/**
 * @author Maria Patrickson
 * @version 1.0
 */
public class PActivityScheduler
{
	private PActivitySchedulerOverlay overlay;

	/**
	 * Creates a new PActivityScheduler with the specified framerate
	 * @param frameRate
	 */
	public PActivityScheduler(int frameRate)
	{
		this.overlay = PActivitySchedulerOverlay.create(frameRate);
	}
	
	/**
	 * Creates a new PActivityScheduler with the specified JavaScript overlay object. 
	 * @param overlay
	 */
	public PActivityScheduler(PActivitySchedulerOverlay overlay)
	{
		this.overlay = overlay;
	}
	
	/**
	 * Schedules the specified activity for execution
	 * @param activity
	 */
	public void schedule(PActivity activity)
	{ 
		overlay.schedule(activity);
	}
	
	public double getGlobalTime()
	{
		return overlay.getGlobalTime();
	}
}

